package corewarsxxi.logic;

import java.io.Serializable;

/**
 * Instruction <code>nop</code> from Core Wars.
 * <p>Contains a static self to be used by all instances of MemoryCell.</p>
 * @version ICWS 88
 * @see     corewarsxxi.logic.OpCode
 * @author  Luís Fonseca, ei10139 @ FEUP
 */
public class nop extends OpCode implements Serializable
{
    /** Simplefied Singleton that provides access to a final static <code>nop</code> instance.*/
    public static final nop self = new nop();

    /**
     * Private constructor of nop.
     */
    private nop() {}

    public void operation(MemoryField aField, MemoryField bField)
    {
    }

    /**
     * Makes use of the Singleton pattern and returns the public static object.
     * @return it<i>self</i>.
     */
    public OpCode getSelf()
    {
        return nop.self;
    }

    /**
     * Overrides the default Object.toString() function.
     * @return Always returns "<code>nop</code>".
     */
    @Override
    public String toString()
    {
        return "nop";
    }
}
